{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = {\n",
    "  \"age\":23,\n",
    "  \"name\":\"wwj\",\n",
    "  \"like\":\"sandwich\"\n",
    "}\n",
    "s = json.dumps(a)\n",
    "print(s)\n",
    "print(type(s))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(json.dumps(a))\n",
    "print(json.dumps(a,indent=2,ensure_ascii=False))\n",
    "print(json.dumps(a,indent=4,ensure_ascii=True,skipkeys=False,sort_keys=True))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "EPOCHS_=[20,60]\n",
    "BATCH_SIZE_=[16, 32, 64]\n",
    "MAX_STEPS_=[16, 32, 64]\n",
    "DROPOUT_RATE_=[0.3, 0.6]\n",
    "LSTM_UNITS_=[32, 64]\n",
    "REGULARIZERS=[0.3, 0.1, 0.01]\n",
    "trainList = []\n",
    "\n",
    "for e in EPOCHS_:\n",
    "  for b in BATCH_SIZE_:\n",
    "    for m in MAX_STEPS_:\n",
    "      for d in DROPOUT_RATE_:\n",
    "        for l in LSTM_UNITS_:\n",
    "          for r in REGULARIZERS:\n",
    "            trainList.append([e, b, m, d, l, r])\n",
    "print(len(trainList))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def updateMoney(data):\n",
    "  money = 0\n",
    "  cur = 0\n",
    "  mt = [1, 3, 7]\n",
    "  for i in range(len(data)):\n",
    "    if data[i] == 0:\n",
    "      money = money +(mt[cur] * 0.96)\n",
    "      cur = 0\n",
    "    else:\n",
    "      for j in range(data[i]):\n",
    "        money = money - mt[cur]\n",
    "        cur = (cur + 1) % len(mt)\n",
    "  print(money )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data =[2, 0, 0, 1, 0, 2, 2, 0, 6, 1, 1, 0, 2, 1, 0, 1, 1, 0, 1, 5, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 1, 2, 0, 2, 0, 2, 1, 0, 1, 0, 0, 3, 3, 2, 0, 0, 0, 7, 0, 0, 1, 5, 4, 0, 0, 0, 0, 0, 1, 0, 1, 3, 1, 0, 1, 0, 2, 0, 3, 0, 1, 0, 1, 0, 6, 1, 0, 0, 1, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 1, 0, 0, 1, 0, 0, 3, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 4, 0, 0, 1, 3, 1, 3, 1, 1, 0, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 2, 1, 2, 0, 0, 3, 0, 0, 6, 0, 1, 0, 3, 0, 0, 0, 0, 0, 1, 4, 3, 2, 0, 3, 0, 0, 1, 0, 4, 0, 2, 0, 0, 1, 0, 0, 3, 3, 0, 0, 0, 1, 1, 2, 3, 0, 1, 0, 0, 1, 0, 0, 3, 0]\n",
    "updateMoney(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "EPOCHS_=[20,60]\n",
    "BATCH_SIZE_=[8, 16, 32, 64]\n",
    "MAX_STEPS_=[8, 16, 32, 64]\n",
    "DROPOUT_RATE_=[0.3, 0.6]\n",
    "LSTM_UNITS_=[16, 32, 64]\n",
    "trainList = []\n",
    "\n",
    "for e in EPOCHS_:\n",
    "  for b in BATCH_SIZE_:\n",
    "    for m in MAX_STEPS_:\n",
    "      for d in DROPOUT_RATE_:\n",
    "        for l in LSTM_UNITS_:\n",
    "          trainList.append([e, b, m, d, l])\n",
    "print(len(trainList))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.13 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "239cd0f6924d34dc9a29cd51ff042db2679e9319f05891fd61214d5969f7bbf8"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
